﻿<?php
require_once(dirname(__FILE__)."/../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../libs/string/libstr.php");
include_once("../libs/login/softadmin_login.php");
$lg=new login();
$mc=new libstr();
$lg->ckmsession();

if($mc->Ismp($_GET['deleteorderid'])!="")
{
	if(!$mc->isnum($_GET['deleteorderid']))
	{
		$mc->msg("非法输入","go");
	}
	$dv=$db->dvstr("select * from order_content where id=".$_GET['deleteorderid']."");
	if(ereg("0,1,",$dv["rootid1"])==1)
	{
		$db->cmd("update  order_content set isshow=-1 where rootid='0,2,' and rootid1='0,1,' and id=".$_GET['deleteorderid']." and userno=".$lg->getsession("userno")."");
	}else 
	{
		$mc->msg("网银支付的订单，无法取消");
	}
    $mc->msg("","../uc_order.php?show=".$mc->Ismp($_GET['show'])."");
}
if($mc->Ismp($_POST["getorderjifen"])!="")
{
	if($mc->Ismp($_POST["dingdanhao"])=="")
	{
		$mc->msg("订单号不能为空","go");
	}
	$dv=$db->dvstr("select count(id) as gj from order_content where userno=".$lg->getsession("userno")." and dingdanhao ='".trim($_POST["dingdanhao"])."' and rootid='0,6,' and jifenstat=0 and jifen<>'0'");
    if($dv["gj"]=="0")
    {
    	$mc->msg("订单号码输入错误或者积分已经获取");
    }
    $dvv=$db->dvstr("select jifen from order_content where userno=".$lg->getsession("userno")." and dingdanhao ='".trim($_POST["dingdanhao"])."' and rootid='0,6,' and jifenstat=0 and jifen<>'0'");
   
    $db->cmd("update member_content set tjifen=tjifen+".$dvv['jifen']." where userno=".$lg->getsession("userno")."");
    $mc->msg("积分获取成功，获取了".$dvv['jifen']."分",$_POST["gourl"]);
}

if($mc->Ismp($_POST["ucuserbtn"])!="")
{
if($mc->request("username","")==""){$mc->msg("姓名不能为空","go");}
if($mc->request("sex","")==""){$mc->msg("性别不能为空","go");}
if($mc->request("email","")==""){$mc->msg("电子邮箱不能为空","go");}
if($mc->request("shouji","")==""){$mc->msg("联系手机不能为空","go");}



$_userid=$mc->request("userid","");
$_username=$mc->request("username","");
$_sex=$mc->request("sex","");
$_email=$mc->request("email","");
$_shouji=$mc->request("shouji","");
$_shenfen=$mc->request("shenfen","");
$_chengshi=$mc->request("chengshi","");
$_tel=$mc->request("tel","");
$_fax=$mc->request("fax","");
$_youbian=$mc->request("youbian","");
$_dizhi=$mc->request("dizhi","");
$_shengri=$mc->request("shengri","1905-12-21");
$_qq=$mc->request("qq","");
$_msn=$mc->request("msn","");
$_web=$mc->request("web","");
$_updatetime=$mc->request("updatetime",date("Y-m-d H:i:s"));
$userno=$mc->Ismp($lg->getsession("userno"));
$db->cmd("update member_content set username='".$_username."',sex='".$_sex."',email='".$_email."',shouji='".$_shouji."',shenfen='".$_shenfen."',chengshi='".$_chengshi."',tel='".$_tel."',fax='".$_fax."',youbian='".$_youbian."',dizhi='".$_dizhi."',shengri='".$_shengri."',qq='".$_qq."',msn='".$_msn."',web='".$_web."',updatetime='".$_updatetime."' where userno=".$userno."");

if($mc->Ismp($_POST["gourl"])!="")
{
$mc->msg("修改成功，按确定返回",$_POST["gourl"]);
}
echo "ok";
exit();
}
if($mc->Ismp($_POST["ucpasswordchangebtn"])!="")
{
	
//	echo $mc->Ismp($_POST['newpassword']);
	if($mc->Ismp($_POST['newpassword'])=="")
	{
		exit();
	}
	if($mc->Ismp($_POST['oldpassword'])=="")
	{
		exit();
	}
	$rs=$db->dvstr("select count(id) as ok from   member_content where password='".strtoupper(md5(trim($_POST['oldpassword'])))."' and userno=".$lg->getsession("userno")."");
	
	if($rs["ok"]=="0")
	{
		echo "no";exit();
	}
	$db->cmd("update member_content set password='".strtoupper(md5(trim($_POST["newpassword"])))."' where userno=".$lg->getsession("userno")."");
    echo "ok";
}

if($mc->Ismp($_POST["cpsave"])!="")
{
	$_a=$mc->request("a","");
	if(trim($_a)=="")
	{
		$mc->msg("内容不能为空","go");
	}
	
		
		
		 $f1=$mc->upfile("file","../uploadfile/company",".jpg,.gif",31);
          if(trim($f1)!="")
          {
		    $f1="pic1='".$f1."',";
          }

	$db->cmd("update gongyingshang_content set ".$f1."a1='".$_a."' where gyid=".$lg->getsession("gyid")."");
	$mc->msg("资料保存成功","../cpgl/company_info.php");
	
}
if($mc->Ismp($_POST["cpsave1"])!="")
{
	$_a=$mc->request("a","");
	if(trim($_a)=="")
	{
		$mc->msg("内容不能为空","go");
	}
	
		
		
		 $f1=$mc->upfile("file","../uploadfile/company",".jpg,.gif",31);
          if(trim($f1)!="")
          {
		    $f1="pic2='".$f1."',";
          }

	$db->cmd("update gongyingshang_content set ".$f1."a2='".$_a."' where gyid=".$lg->getsession("gyid")."");
	$mc->msg("资料保存成功","../cpgl/company_info1.php");
	
}

if($mc->Ismp($_POST["cpsave2"])!="")
{
	$_a=$mc->request("a","");
	if(trim($_a)=="")
	{
		$mc->msg("内容不能为空","go");
	}
	
		
		
		 $f1=$mc->upfile("file","../uploadfile/company",".jpg,.gif",31);
          if(trim($f1)!="")
          {
		    $f1="pic3='".$f1."',";
          }

	$db->cmd("update gongyingshang_content set ".$f1."a3='".$_a."' where gyid=".$lg->getsession("gyid")."");
	$mc->msg("资料保存成功","../cpgl/company_info2.php");
	
}
if($mc->Ismp($_POST["cpsave3"])!="")
{
	$_a=$mc->request("a","");
	if(trim($_a)=="")
	{
		$mc->msg("内容不能为空","go");
	}
	
		
		
		 $f1=$mc->upfile("file","../uploadfile/company",".jpg,.gif",31);
          if(trim($f1)!="")
          {
		    $f1="pic4='".$f1."',";
          }

	$db->cmd("update gongyingshang_content set ".$f1."a4='".$_a."' where gyid=".$lg->getsession("gyid")."");
	$mc->msg("资料保存成功","../cpgl/company_info3.php");
	
}
?>